<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

	
<!-- ******* header 시작 ******** -->
<style type="text/css">
		html, body { margin: 0;	padding: 0; }
		ul.menu { margin: 0 auto 0 auto; }
</style>

<script type="text/javascript">

$(function(){

	 $.ajax({
			type:"post",
			url:"${initParam.root}auction/findByCategory.do",
			datatype:"json",
			success:function(data){		
				 var categorylist="<li><a href='${initParam.root}notice/getNoticeBoardList.do'>공지사항</a></li>"; 					
				 $.each(data, function(index, value){
					 categorylist+="<center><li name='big' id="+index+" value='"+value.bigClassNo+"'><a href='#'>"+value.bigClassName+"</a>";
					
					 if(value.bigClassNo!=""){
					 
					 $.ajax({
							type:"post",
							url:"${initParam.root}auction/getSmallClassList.do",
							datatype:"json",
							data:"bigClass="+value.bigClassNo,
							async: false,
							success:function(data){						
								categorylist+="<ul>"; 
								$.each(data, function(index, value){
									categorylist+="<li><a href='${initParam.root}auction/findBySmallClass.do?smallClassNo="+value.smallClassNo+"'>"+value.smallClassName+"</a></li>";							
								});						
								categorylist+="</ul>"; 
							}//success
						});//ajax
					}
					 categorylist+="</li></center>";
				});	
				
				$("#category").html(categorylist); 
			}//success
		});//ajax	

	$("#findByKeywordForm").submit(function(){
		var keyword = $("#keyword");
		if(keyword.val()==""){
			alert("검색어를 입력하세요.");
			return false;
		}
	});//submit	
	
});//ready
</script>
<table  class="title">
	<tr>
		<td width="300px" >
		 <a href="${initParam.root}notice/home.do"><img src="${initParam.root}images/home.jpg"></a>
		</td>
		
		<td width="800px" >
			<form id="findByCategoryForm" method="post" action="${initParam.root}auction/findByCategory.do">
				<ul style="margin-top: 80px" class="menu" id="category" >	</ul> 
			</form>		
		</td>
		<td width="300px">
			<form id="findByKeywordForm" method="get" action="${initParam.root}auction/findByKeyword.do">
			 <div style="margin-top: 80px"><input type="text" name="keyword" id="keyword"> <input type="submit"  value="검색"></div>
			</form>
		</td>
	</tr>
</table>
	
<!-- ******header 끝*******  -->	